BlockingCollection(T) Constructor (Int32)

Task Parallel System.Threading

Initializes a new instance of the BlockingCollection<(Of <(T>)>) class with the specified upper-bound.

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Sub New ( _
	boundedCapacity As Integer _
)
C#
public BlockingCollection(
	int boundedCapacity
)

Parameters

boundedCapacity
Type: System..::.Int32
The bounded size of the collection.

Remarks

The default underlying collection is a ConcurrentQueue<T>.

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeExceptionThe boundedCapacity is not a positive value.

See Also